// eslint-disable-next-line no-unused-vars
import { get, post, deletes, upload } from "./request";

//轮播
export const getSwiper = () => get("/index/getSwiper", {});

//登陆
export const login = ({ username, password }) =>
  post("/user/login", { username, password });

//注册
export const register = ({ username, password, phone_code }) =>
  post("/user/register", { username, password, phone_code });

//重置密码
export const forget = ({ username, old_password, new_password }) =>
  post("/user/forget", { username, old_password, new_password });

//短信验证码获取
export const getSMS = ({ username }) => get("/user/getSMS", { username });

//推荐
export const getRecommend = () => get("/index/getRecommend", {});

//促销
export const getSale = () => get("/index/getSale", {});

//icon
export const getIcon = () => get("/index/getIcon", {});

//分类
export const getCategory = () => get("/category/getCategory", {});
export const message = () => get("/chat/message", {});
export const private_detail = to_user =>
  get("/chat/private_detail", { to_user });
export const private_save_msg = ({
  from_user,
  to_user,
  name,
  message,
  status = "1",
  time
}) =>
  post("/chat/private_save_msg", {
    from_user,
    to_user,
    name,
    message,
    status,
    time
  });
